#ifndef _CJSON_H_
#define _CJSON_H_

#include <string.h>
#include <stdlib.h>
#include <stdio.h>
/* type of json data */
enum cjson_format
{
    CJSON_FORMAT_NUMBER_UNSIGNED_CHAR,
    CJSON_FORMAT_NUMBER_INT,
    CJSON_FORMAT_NUMBER_DOUBLE,
    CJSON_FORMAT_NUMBER_LONG,
    CJSON_FORMAT_STRING
    /* TBD */
};

#define CJSON_BUFFER_SIZE 1024


int cjson_init_file(const char *file);

/* one-level cjson */
int cjson_set_data_by_one_level(const char *file, void *which_node, enum cjson_format cjson_fmt, void *data);

int cjson_get_data_by_one_level(const char *file, void *which_node, enum cjson_format cjson_fmt, void *info);

int cjson_delete_data_by_one_level(const char *file, void *which_node);

/* two-level cjson */
int cjson_set_data_by_two_level(const char *file, void *first_node, void *second_node, enum cjson_format fmt, void *data);

int cjson_get_data_by_two_level(const char *file, void *first_node, void *second_node, enum cjson_format fmt, void *data);

int cjson_delete_data_by_two_level(const char *file, void *first_node, void *second_node);
#endif /* _CJSON_H_ */